package com.isaac.service.impl;

import com.isaac.MethodService;

import java.util.concurrent.TimeUnit;

public class MethodServiceImpl implements MethodService {
    public String methodA(String name, int mills) {

        try {
            TimeUnit.MILLISECONDS.sleep(mills);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Called Method-A: [" + name + "]......SLEEP:["+mills+"]");

        return "Method-A[" + name +"]";
    }

    public String methodB(String name, int mills) {
        try {
            TimeUnit.MILLISECONDS.sleep(mills);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Called Method-B: [" + name + "]......SLEEP:["+mills+"]");

        return "Method-B[" + name +"]";
    }

    public String methodC(String name, int mills) {
        try {
            TimeUnit.MILLISECONDS.sleep(mills);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Called Method-C: [" + name + "]......SLEEP:["+mills+"]");

        return "Method-C[" + name +"]";
    }
}
